import useMicroStore from '@apps/_share/store/micro'

const { $t } = useMicroStore()

export const schemas = [
  {
    title: $t('项目名'),
    field: 'test',
    column: 1,
    component: {
      vm: 'el-input',
      value: '',
      props: { placeholder: $t('请输入') },
    },
  },
  {
    title: $t('状态'),
    field: 'status',
    column: 1,
    component: {
      vm: 'BaseSelect',
      value: '',
      props: {
        api: async () => ({
          result: [{
            label: '开启',
            value: '1',
          }, {
            label: '关闭',
            value: '2',
          }],
        }),
        apiParams: {
          a: 1,
          b: 2,
        },
        multiple: true,
        placeholders: $t('全部'),
      },
      listeners: {
        change(v: string) {
          console.log('change>>>>', v)
        },
      },
    },
  },
]

export const columns = [
  {
    prop: 'projectName',
    label: $t('项目名'),
    align: 'center',
    minWidth: 150,
  },
  {
    prop: 'projectCode',
    label: $t('项目code'),
    align: 'center',
    minWidth: 120,
  },
  // {
  //   prop: 'domains',
  //   label: $t('域名'),
  //   align: 'center',
  //   slot: 'domains',
  //   minWidth: 200,
  // },
  // {
  //   prop: 'typeName',
  //   label: $t('类型'),
  //   align: 'center',
  //   minWidth: 120,
  // },
  {
    prop: 'statusName',
    label: $t('状态'),
    align: 'center',
    minWidth: 90,
  },
  {
    prop: 'createName',
    label: $t('创建人'),
    align: 'center',
    minWidth: 120,
  },
  {
    prop: 'createTime',
    label: $t('创建时间'),
    align: 'center',
    minWidth: 190,
  },
  {
    prop: 'modifyName',
    label: $t('修改人'),
    align: 'center',
    minWidth: 120,
  },
  {
    prop: 'modifyTime',
    label: $t('修改时间'),
    align: 'center',
    minWidth: 190,
  },
  {
    label: $t('操作'),
    slot: 'operation',
    align: 'center',
    fixed: 'right',
    minWidth: 170,
  },
]
